package jdk7.others;

import java.nio.file.Path;
import java.nio.file.Paths;

public class TestPath {
	public void usePath() {
		Path path1 = Paths.get("folder1", "sub1");
		Path path2 = Paths.get("folder2", "sub2");
		path1.resolve(path2); // folder1\sub1\folder2\sub2
		path1.resolveSibling(path2); // folder1\folder2\sub2
		path1.relativize(path2); // ..\..\folder2\sub2
		path1.subpath(0, 1); // folder1
		path1.startsWith(path2); // false
		path1.endsWith(path2); // false
		Paths.get("folder1/./../folder2/my.text").normalize(); // folder2\my.text
	}

	/**
	 * @param args the command line arguments
	 */
	public static void main(String[] args) {
		TestPath usage = new TestPath();
		usage.usePath();
	}
}